//
//  LGNFilterCollectionViewCell.m
//  LGNnglishTeaching
//
//  Created by 刘亚军 on 2021/11/4.
//  Copyright © 2021 刘亚军. All rights reserved.
//

#import "LGNFilterCollectionViewCell.h"
#import "LGKConst.h"
@interface LGNFilterCollectionViewCell ()
@property (strong, nonatomic) UILabel *contentL;
@end
@implementation LGNFilterCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self layoutUI];
    }
    return self;
}
- (void)layoutUI{
    self.contentView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.contentL];
    [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    [self yj_clipLayerWithRadius:4 width:0 color:nil];
}
- (void)setText:(NSString *)text{
    _text = text;
    self.contentL.text = text;
}

- (void)setIsChoice:(BOOL)isChoice{
    _isChoice = isChoice;
    if (_isChoice) {
        self.contentL.textColor = LG_ColorWithHex(0x0099ff);
        self.contentL.backgroundColor = LG_ColorWithHex(0xD6EFFF);
    }else{
        self.contentL.textColor = LG_ColorWithHex(0x333333);
        self.contentL.backgroundColor = LG_ColorWithHex(0xF9F9F9);
    }
}
+ (CGFloat)height{
    return LG_IS_IPAD ? 40 : 36;
}
- (UILabel *)contentL{
    if (!_contentL) {
        _contentL = [[UILabel alloc] init];
        _contentL.textAlignment = NSTextAlignmentCenter;
        _contentL.font = [UIFont systemFontOfSize:LG_IS_IPAD ? 16 : 15];
        _contentL.numberOfLines = 0;
        _contentL.textColor = LG_ColorWithHex(0x333333);
        _contentL.backgroundColor = LG_ColorWithHex(0xF9F9F9);
    }
    return _contentL;
}
@end
